#ifndef RECORDWIDGET_H
#define RECORDWIDGET_H

#include <QWidget>
#include <QLabel>   //标签
#include <QPushButton>  //按钮
#include <QMessageBox>
#include "model/usermodel.h"
#include <QCloseEvent>
#include "code/decodevideo.h"
#include <QPainter>
#include <QImage>
#include <QDateTime>
#include <QSlider>
#include "model/configuremodel.h"
#include "model/logmodel.h"
#include "model/videomodel.h"
#include <QList>

class RecordWidget : public QWidget
{
    Q_OBJECT
public:
    RecordWidget(QWidget *parent = nullptr);
    RecordWidget(QList<QString> videoList, QString path);
    void init_window();
    void init_control();
    void init_connect();


private:
    QLabel *title;
    QPushButton *backBtn, *beginBtn, *preBtn, *nextBtn, *screenBtn, *btn2, *btn5, *btn4;
    QImage image;
    DecodeVideo *decode;
    QSlider *slider;
    int x=0;

    //记录播放第几个视频的下标
    int index=0;
    QList<QString> videoList;

    // QWidget interface
protected:
    void closeEvent(QCloseEvent *event);
    void paintEvent(QPaintEvent *event);
public slots:
    void on_button_click();
    void receiveImg(QImage img);
    void on_button2_click();
    void on_button3_click();
    void on_button4_click();

    //播放上一个视频
    void preVideo();

    //播放下一个视频
    void nextVideo();

    //截图
    void on_button5_click();

    //滑块移动
//    void ValueChanged(int val);

signals:
    void backToPalyWidget();
};

#endif // RECORDWIDGET_H
